<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<title>初心博客后台管理系统</title>
<link rel="icon" href="favicon.ico" type="image/ico">
<meta name="keywords" content="LightYear,光年,后台模板,后台管理系统,光年HTML模板">
<meta name="description" content="LightYear是一个基于Bootstrap v3.3.7的后台管理系统的HTML模板。">
<meta name="author" content="yinqi">
<link href="/plugins/bootstrap/css/bootstrap.css" rel="stylesheet">
<link href="/css/materialdesignicons.min.css" rel="stylesheet">
<link href="/css/admin.css" rel="stylesheet">
</head>
  
<body>
<div class="lyear-layout-web">
  <div class="lyear-layout-container">
      <!--左侧导航-->
      <% include sliderBar%>
      <!--End 左侧导航-->
      
      <!--头部信息-->
      <% include headerBar%>
      <!--End 头部信息-->
    
    <!--页面主要内容-->
    <main class="lyear-layout-content">
      
      <div class="container-fluid">                          
        

        <div class="row">
          <div class="col-lg-12">
            <div class="card">
              <div class="card-toolbar clearfix">
                <form class="pull-right search-bar" method="get" action="#!" role="form">
                  <div class="input-group">
                      <input type="text" class="form-control" value="" name="keyword" placeholder="请输入名称">
                    <div class="input-group-btn">                                            
                      <button class="btn btn-default" id="search-btn"  type="button">搜索</button>                   
                    </div>
                    
                  </div>
                </form>
                <div class="toolbar-btn-action">
                  <a class="btn btn-primary m-r-5" href="/admin/addArtical"><i class="mdi mdi-plus"></i> 新增</a>                
                </div>
              </div>
              <div class="card-body">
                
                <div class="table-responsive">
                  <table class="table table-bordered">
                    <thead>
                      <tr>                         
                              <th>编号</th>
                              <th>文章名</th>
                              <th>文章分类</th>
                              <th>状态</th>
                              <th>发布人</th>
                              <th>创建时间</th>
                              <th>操作</th>
                      </tr>
                    </thead>
                    <tbody>
                      <%articals.forEach(function(artical){%>
                        <tr>                      
                            <td><%=artical.articalId%></td>
                            <td><%=artical.articalName%></td>
                            <td><%=artical.className%></td>
                            <td>
                              <%if(artical.status){%>
                                <font class="text-success">正常</font>
                             <% }else{%>
                                <font class="text-danger">禁用</font>
                             <% }%>
                             
                            </td>
                            <td><%=artical.userName%></td>
                            <td><%=artical.createTime%></td>                                  
                            <td>
                              <div class="btn-group">
                                <a class="btn btn-xs btn-default" href="/admin/editAtical/<%=artical.articalId%>" title="" data-toggle="tooltip" data-original-title="编辑"><i class="mdi mdi-pencil"></i></a>
                                <a class="btn btn-xs btn-default" href="/admin/deleteAtical/<%=artical.articalId%>" title="" data-toggle="tooltip" data-original-title="删除"><i class="mdi mdi-window-close"></i></a>
                              </div>
                            </td>
                          </tr>        
                      <%})%>
                                

                  

                    </tbody>
                  </table>
                </div>
                <!-- 分页菜单 -->
                <div class="pagebox" style="text-align: right">

                </div>
       
              </div>
            </div>
          </div>
          
        </div>    
        
      </div>
      
    </main>
    <!--End 页面主要内容-->
  </div>
</div>

<script type="text/javascript" src="../plugins/jquery/jquery-3.4.0.min.js"></script>
<script type="text/javascript" src="../plugins/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="../js/perfect-scrollbar.min.js"></script>
<script src="../plugins/bootstrapPager.js"></script>
<script type="text/javascript" src="../js/main.min.js"></script>
<script>
    //后台用户页面
    var total = <%=total%>;
  var pagehtml = Pager({
      totalCount: total, //总条数为150
      pageSize: 5, //每页显示6条内容，默认10
      buttonSize: 6, //显示6个按钮，默认10
      pageParam: 'page', //页码的参数名为'p'，默认为'page'
      className: 'pagination', //分页的样式
      prevButton: '上一页', //上一页按钮
      nextButton: '下一页', //下一页按钮
      firstButton: '首页', //第一页按钮
      lastButton: '末页', //最后一页按钮
  })
  $('.pagebox').html(pagehtml)

</script>
</body>
</html>